
import requests

data = {
    "name": "zhangsan",
    "age": 18
}

headers = {
    'user-agent': 'xxxx'
}

# data传的是字段，json传的是json格式
# response = requests.post("http://httpbin.org/post", data=data)
response = requests.post("http://httpbin.org/post", json=data, headers=headers)

print(response.text)